#include "mySerial.h"
#include "usart.h"



char data[30] = {0};
uint8_t dat;
uint pointer;

void MySerial_Init(void)
{
	HAL_UART_Receive_IT(&huart1,&dat,1);
}

void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
//	printf("there is rxr\n");
	data[pointer++] = dat;
  HAL_UART_Receive_IT(&huart1,&dat,1);	
}

int fputc(int ch ,FILE *f)
{
		HAL_UART_Transmit(&huart1,(uint8_t *)&ch,1,0xfff);
		return ch;
}